Look up icon themes in the directories specified in the icon theme spec:
authorMatthias Clasen <mclasen@redhat.com>
Tue, 17 Aug 2004 19:51:11 +0000 (19:51 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 17 Aug 2004 19:51:11 +0000 (19:51 +0000)
2004-08-17  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkicontheme.c (gtk_icon_theme_init): Look up icon themes in the
directories specified in the icon theme spec: $HOME/.icons,
$XDG_DATA_DIRS/icons, /usr/share/pixmaps. Note that GTK+ used to also look
in $GTK_DATA_DIR/icons, $GTK_DATA_DIR/pixmaps and /usr/share/icons.  (#148694)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkicontheme.c

index fb47b318cdebb619b781ee15f09987ef25865ca8..b3724e68daade81dcf436a20e91126dc624ebb35 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2004-08-17  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkicontheme.c (gtk_icon_theme_init): Look up icon themes in the 
+       directories specified in the icon theme spec: $HOME/.icons, 
+       $XDG_DATA_DIRS/icons, /usr/share/pixmaps. Note that GTK+ used to also look 
+       in $GTK_DATA_DIR/icons, $GTK_DATA_DIR/pixmaps and /usr/share/icons.  (#148694)
+       
+
        * gtk/gtkframe.c (gtk_frame_paint): Take widget->state into account when
        painting the shadows.  (#150351, Tim Janik)
 
index fb47b318cdebb619b781ee15f09987ef25865ca8..b3724e68daade81dcf436a20e91126dc624ebb35 100644 (file)
@@ -1,5 +1,11 @@
 2004-08-17  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkicontheme.c (gtk_icon_theme_init): Look up icon themes in the 
+       directories specified in the icon theme spec: $HOME/.icons, 
+       $XDG_DATA_DIRS/icons, /usr/share/pixmaps. Note that GTK+ used to also look 
+       in $GTK_DATA_DIR/icons, $GTK_DATA_DIR/pixmaps and /usr/share/icons.  (#148694)
+       
+
        * gtk/gtkframe.c (gtk_frame_paint): Take widget->state into account when
        painting the shadows.  (#150351, Tim Janik)
 
index fb47b318cdebb619b781ee15f09987ef25865ca8..b3724e68daade81dcf436a20e91126dc624ebb35 100644 (file)
@@ -1,5 +1,11 @@
 2004-08-17  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkicontheme.c (gtk_icon_theme_init): Look up icon themes in the 
+       directories specified in the icon theme spec: $HOME/.icons, 
+       $XDG_DATA_DIRS/icons, /usr/share/pixmaps. Note that GTK+ used to also look 
+       in $GTK_DATA_DIR/icons, $GTK_DATA_DIR/pixmaps and /usr/share/icons.  (#148694)
+       
+
        * gtk/gtkframe.c (gtk_frame_paint): Take widget->state into account when
        painting the shadows.  (#150351, Tim Janik)
 
index fb47b318cdebb619b781ee15f09987ef25865ca8..b3724e68daade81dcf436a20e91126dc624ebb35 100644 (file)
@@ -1,5 +1,11 @@
 2004-08-17  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkicontheme.c (gtk_icon_theme_init): Look up icon themes in the 
+       directories specified in the icon theme spec: $HOME/.icons, 
+       $XDG_DATA_DIRS/icons, /usr/share/pixmaps. Note that GTK+ used to also look 
+       in $GTK_DATA_DIR/icons, $GTK_DATA_DIR/pixmaps and /usr/share/icons.  (#148694)
+       
+
        * gtk/gtkframe.c (gtk_frame_paint): Take widget->state into account when
        painting the shadows.  (#150351, Tim Janik)
 
index b8db2b64022f317a15cd2263f07178adf61011c9..edc6ca64be75e5d6a55a09fe4fd0167b9d68d462 100644 (file)
@@ -524,24 +524,31 @@ static void
 gtk_icon_theme_init (GtkIconTheme *icon_theme)
 {
   GtkIconThemePrivate *priv;
-
+  gchar **xdg_data_dirs;
+  int i, j;
+  
   priv = g_type_instance_get_private ((GTypeInstance *)icon_theme,
                                      GTK_TYPE_ICON_THEME);
   icon_theme->priv = priv;
 
   priv->custom_theme = FALSE;
   priv->current_theme = g_strdup (DEFAULT_THEME_NAME);
-  priv->search_path = g_new (char *, 5);
+
+  xdg_data_dirs = g_get_system_data_dirs ();
+  for (i = 0; xdg_data_dirs[i]; i++) ;
+
+  priv->search_path_len = i + 3;
+  
+  priv->search_path = g_new (char *, priv->search_path_len);
+  
+  i = 0;
+  priv->search_path[i++] = g_build_filename (g_get_home_dir (), ".icons", NULL);
+  priv->search_path[i++] = g_build_filename (g_get_user_data_dir (), "icons", NULL);
   
+  for (j = 0; xdg_data_dirs[j]; j++) 
+    priv->search_path[i++] = g_build_filename (xdg_data_dirs[j], "icons", NULL);
 
-  priv->search_path[0] = g_build_filename (g_get_home_dir (),
-                                          ".icons",
-                                          NULL);
-  priv->search_path[1] = g_build_filename (GTK_DATADIR, "pixmaps", NULL);
-  priv->search_path[2] = g_build_filename (GTK_DATADIR, "icons", NULL);
-  priv->search_path[3] = g_strdup ("/usr/share/icons");
-  priv->search_path[4] = g_strdup ("/usr/share/pixmaps");
-  priv->search_path_len = 5;
+  priv->search_path[i++] = g_strdup ("/usr/share/pixmaps");
 
   priv->themes_valid = FALSE;
   priv->themes = NULL;